<?php use application\Comm\Func;
$pager = new \application\Comm\Pager($page);?>

<link rel="stylesheet" href="<?php echo Func::staticUrl('stylesheets/css/index.css?v=20180310')?>">
<link rel="stylesheet" href="<?php echo Func::staticUrl('css/stores/stores.css')?>">

<div class="banner_img1">
	<a href="javascript:void(0);" style="background:url(images/stores/bannerfenbu.jpg) no-repeat center top;"></a>
</div>
<div class="banner_img2">
	<div class="container">
		<img src="images/stores/bt.jpg" alt="">
	</div>
 </div>
<div class="store_search">
	<form action="<?=Func::createUrl('site/stores')?>" method="get" id='form1'>
		<div class="AddressList address_list">
			<label class="select_label">
				<select class="province fl mg_r_15" data-value="<?=$province ?>" name="province" onchange="pGetStores()">
					<option value="">请选择省</option>
				</select>
			</label>
			<label class="select_label">
				<select class="city fl" name="city"  data-value="<?=$city ?>" onchange="cGetStores()">
					<option value="">请选择市</option>
				</select>
			</label>
<!-- 			<label class="select_label_input">-->
<!-- 				<input type="text" class="storesp" placeholder="搜索城市">-->
<!-- 			</label>-->
<!-- 			<label class="select_label_btn"><a href=""></a></label>-->
		</div>
	</form>
	<div class="hot_city">
		<b>热门城市：</b>
		<a href="<?= Func::createUrl('site/stores',['province'=>'111'])?>">北京</a>
		<a href="<?= Func::createUrl('site/stores',['province'=>'131'])?>">上海</a>
		<a href="<?= Func::createUrl('site/stores',['city'=>'144001'])?>">广州</a>
		<a href="<?= Func::createUrl('site/stores',['city'=>'144003'])?>">深圳</a>
	</div>
</div>
 <div class="stores_bottom container clearfix">
	<ul class="st_lists clearfix">
	<?php foreach ($data as $k =>$v){?>
		<li>
			<!--  <div class="stores_city">
				城市：<span><?php echo $v['area_fix'];?></span>
			</div>-->
			
			<div class="stores_mc">
				<span><?= str_replace('衣柜', '全屋定制', $v['name']);?></span>
			</div>
			<div class="stores_time">
				营业时间：<time>10:00 — 18:00</time>
			</div>
			<div class="stores_address clearfix">
				地址：<span><?php echo $v['area_fix'].'-'.$v['address'];?></span>
			</div>
			<div class="stores_contact">
				<a class="map" target="__blank" href="http://map.baidu.com/?l=&s=s%26wd%3D<?=$v['area_fix'].$v['address'];?>&output=html">查看地图</a>
				<a class="kf" href="javascript:void(0);">咨询客服</a>
			</div>
		</li>
		<?php }?>
	</ul>
	<div class="page clearfix">
					<?php
		             echo $pager->show('2');
		          	?>
    </div>

</div>


<!--尾部-->   
<script type="text/javascript">
	 $(".banner .down").mouseleave(function() {
        //alert(111)
        $(".down_menu_l").css("display","none");
    })
	function pGetStores(){
		var province = $('.province').val();
		$('.city').val('');
		upstores(province,'');
	}

	function cGetStores(){
		var province = $('.province').val();
		var city = $('.city').val();
		upstores(province,city)
	}

	function upstores(province,city)
	{
		$('#form1').submit();
// 		$.ajax({
	//		 url: "<?php //echo Func::createUrl('site/dostores')?>",
// 			 data: {'province':province,'city':city},
// 			 dataType:'json',
// 			 success: function(msg)
// 			 {
// 				var data = msg;
// 				var str ='';
// 				var len = data.data.length
// 				for(var i = 0;i<len;i++)
// 					{
// 					console.log(data.data[i].name);
// 						str +='<li>';
// 						str +='<span>'+data.data[i].name+'</span>';
// 						str +='<p>'+data.data[i].area_fix  +'-'+data.data[i].address+'</p>';	
// 						str +='<address>'+data.data[i].phone+'</address>';
// 		                str +='<!-- <div class="send"><a href="#"><i class="phone"></i><span>免费发送到手机</span></a></div> -->';  
// 		                str +='<div class="send"><a href="http://map.baidu.com/?l=&s=s%26wd%3D'+data.data[i].area_fix  +data.data[i].address+'&output=html"><i class="maps"></i><span>地图查找</span></a></div>';  
// 		                str +='</li>';        
// 					}
// 				var checkText = province != '' ? $(".province").find("option:selected").text() : '全国';  
// 				$('#addresss').text(checkText);
				
// 				$('.box').html('');
// 				$('.box').append(str);
// 	      	}
// 	      });
	}

</script>
<script>
    $(".AddressList").Address();
</script>
